package com.lu.proxy.myproxy;

import com.lu.proxy.interfaces.ClothFactory;

/**
 * @Date:2021/11/8/21:32
 * @Description:代理类测试
 */
public class ProxyClothFactory implements ClothFactory {

    private ClothFactory factory;  //用被代理类对象进行实例化

    public ProxyClothFactory( ClothFactory factory){
        this.factory = factory;
    }

    @Override
    public void produceCloth() {
        System.out.println("我是代理类ProxyClothFactory");

        factory.produceCloth(); //这个对象是被代理类

        System.out.println("代理工厂做些后续的收尾工作");
    }
}
